<!--
  @author heguanghua
  @since 2019/06/12 11:57
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<table class="layui-hide" id="zmn-table" lay-filter="zmn-table" th:fragment="table">
    <thead>
    <tr>
        <th lay-data="{type:'checkbox', width:50, unresize:true, align:'center', fixed:'left'}"></th>
        <th lay-data="{field:'sort', width:60, unresize:true, sort:true, align:'center', edit:'text', fixed:'left'}">排序</th>
        <th lay-data="{field:'channelId', width:80, unresize:true, align:'center', sort: true, fixed:'left'}">渠道ID</th>
        <th lay-data="{field:'name', minWidth:120, unresize:true, align:'left', fixed:'left'}">渠道名称</th>
        <th th:if="${#authPermit.checkPermit('/channel/showInnerName.action')}"
            lay-data="{field:'innerName', minWidth:120, unresize:true, align:'left'}">内部名称
        </th>
        <th lay-data="{field:'channelType', width:100, unresize:true, align:'center'}">渠道类型</th>
        <th lay-data="{field:'plat', width:100, unresize:true, align:'center'}">所属平台</th>
        <th lay-data="{field:'deptName', width:230, unresize:true, align:'center'}">商务部门</th>
        <th lay-data="{field:'rank', width:100, unresize:true, align:'center'}">渠道级别</th>
        <th lay-data="{field:'abutmenterName', width:160, unresize:true, align:'center'}">责任人</th>
        <th lay-data="{field:'status', width:100, unresize:true, align:'center'}">状态</th>
        <th lay-data="{field:'updateTime', width:200, unresize:true, align:'center'}">最近修改人/时间</th>
        <th lay-data="{field:'操作', width:70, unresize:true, align:'center', fixed:'right'}">操作</th>
    </tr>
    </thead>
    <tbody>
    <tr th:each="item,itemStat:${items}">
        <td></td>
        <td th:text="${item.sort}">sort</td>
        <td th:text="${item.channelId}"></td>
        <td th:text="${item.name}"></td>
        <td th:if="${#authPermit.checkPermit('/channel/showInnerName.action')}"
            th:text="${(item.innerName == null || item.innerName == '') ? '--' : item.innerName}"></td>
        <td th:text="${T(com.zmn.plat.common.dictionary.ChannelTypeEnum).getName(item.channelType)}"></td>
        <td th:text="${T(com.zmn.common.constant.GlobalConsts).getPlatName(item.plat)}"></td>
        <td th:text="${(T(com.zmn.common.utils.string.StringUtil).isBlank(item.oneDeptName) ? '' : item.oneDeptName + '/') + (T(com.zmn.common.utils.string.StringUtil).isBlank(item.deptName)?'--':item.deptName)}"></td>
        <td th:text="${item.rank == 1 ? '一级' : '二级'}">渠道等级</td>
        <td th:text="${T(com.zmn.common.utils.string.StringUtil).isBlank(item.abutmenterName) ? '--' : item.abutmenterName}">--</td>
        <!--<td th:text="${T(com.zmn.plat.manager.dictionary.StatusEnum).of(item.status).getName()}"></td>-->
        <td>
            <input type="checkbox" name="status" id="status" th:key="${item.channelId}" th:value="${item.status}"
                   lay-text="ON|OFF" lay-skin="switch" lay-filter="chk_status" th:checked="${item.status == 2}"/>

        </td>

        <td th:text="${item.updater+'/'+T(com.zmn.common.utils.date.DateUtil).toString(item.updateTime)}">updateTime</td>
        <!--<td>-->
        <!--<a th:lay-href="|/channel/detail.action?channelId=${item.channelId}|" lay-text="渠道信息">详情</a>-->
        <!--</td>-->
        <td>
            <a class="layui-btn layui-btn-xs btn-operate" th:data-id="${item.channelId}" th:data-index="${itemStat.index}">操作</a>
        </td>
    </tr>
    </tbody>
</table>
